<?php
  class DBConnect{
    static private $adr = 'mysql:host=localhost;dbname=phplesson3';
    static private $db_login='root';
    static private $db_pass='';
    static private $db = NULL;
    static private $instance = NULL;
    static function getDBConnect(){
      if (self::$instance == NULL)
      {
        self::$instance = new DBConnect();
        self::$db = new PDO(self::$adr, self::$db_login, self::$db_pass);
      }
      return self::$db;
    }

    private function __construct(){}
    private function __clone(){}
  }
?>